package com.ctshk.rpc.user.mapper.es;


import com.ctshk.rpc.user.entity.es.OrderEs;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * <p>
 *
 * </p>
 *
 * @author 李新科
 * @date 2021/5/20 14:55
 */
@Repository
public interface OrderEsMapper extends ElasticsearchRepository<OrderEs,Long> {

    Page<OrderEs> findByCreateIdOrderByIdDesc(Long createId, Pageable pageable);

    OrderEs findOrderEsByOrderNumberAndQueryNumber(String orderNumber,String queryNumber);

    Page<OrderEs> findAll(Pageable pageable);

    Page<OrderEs> findAllByTypeIn(List<Integer> typeList, Pageable pageable);

    Optional<OrderEs> findByIdAndUserId(Long id,Long userId);
}
